package com.papercutting.platform.controller;

import com.papercutting.platform.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 基础控制器
 */
@RestController
@RequestMapping("/api")
public class BaseController {
    
    /**
     * 健康检查
     */
    @GetMapping("/health")
    public Result<Map<String, Object>> health() {
        Map<String, Object> data = new HashMap<>();
        data.put("status", "UP");
        data.put("timestamp", System.currentTimeMillis());
        data.put("version", "1.0.0");
        data.put("description", "中国剪纸展示平台后端服务");
        
        return Result.success("服务运行正常", data);
    }
    
    /**
     * 获取系统信息
     */
    @GetMapping("/info")
    public Result<Map<String, Object>> info() {
        Map<String, Object> data = new HashMap<>();
        data.put("name", "中国剪纸展示平台");
        data.put("version", "1.0.0");
        data.put("author", "毕业设计开发者");
        data.put("description", "基于微信小程序的中国剪纸文化展示与教学平台");
        data.put("technology", "Spring Boot + MySQL + Redis + 微信小程序");
        
        return Result.success(data);
    }
}